package cn.wangzengqiang.study.designpattern.singleton;

/**
 * 懒汉式单例 （线程安全，效率低）
 */
public class SafeLazyManSingleton {
    private static SafeLazyManSingleton instance = null;

    private SafeLazyManSingleton() {
    }

    public static synchronized SafeLazyManSingleton getInstance() {
        if (instance == null) {
            instance = new SafeLazyManSingleton();
        }

        return instance;
    }
}
